﻿using System.Text.Json.Serialization;

namespace UI.Models
{

    public class NameTextModel
    {
        public string NAME { get; set; }

        [JsonPropertyName("#text")]
        public string text { private get; set; }

        public string txt
        {
            get
            {
                if (string.IsNullOrWhiteSpace(text))
                {
                    return "";
                }
                return text;
            }
        }
    }

    public class TaskNodeModel
    {
        /// <summary>
        /// 审批编号
        /// </summary>
        public string TID { get; set; }

        /// <summary>
        /// 审批节点编号
        /// </summary>
        public string NID { get; set; }

        /// <summary>
        /// 审批角色编号，审批用户
        /// </summary>
        internal string GR { get; set; }

        public string GR_ROLE => GR?.Split(",")[0];

        public string GR_USER => GR?.Split(",")[1];

        /// <summary>
        /// 交易编号
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 是否会签角色 True 会签角色，false正常角色
        /// </summary>
        [JsonPropertyName("isCCRole")]
        public bool ISCCROLE { get; set; }

        public string SUBMITUESER { get; set; }

        public string SUBMITUESER_JOB { get; set; }

        /// <summary>
        /// 交易方向
        /// </summary>
        public string TY { get; set; }

        public string CASHDIRECTION { get; set; }

        /// <summary>
        /// 交易日期
        /// </summary>
        public string OR { get; set; }

        /// <summary>
        /// 交易日期
        /// </summary>
        public IEnumerable<NameTextModel> R { get; set; }
    }
}
